package org.jeecg.chase.modules.task;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.chase.modules.api.service.ApiService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author leikai
 * @version 1.0
 * @description: 优惠券任务
 * @date 2022/03/15/0015 20:44
 */
@Component
@Slf4j
public class CouponTask implements Job {

    @Autowired
    private ApiService apiService;


    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("开始执行定时任务");
        this.apiService.updateCouponStatus();
        log.info("定时任务执行结束");
    }
}
